﻿using System.Collections.Generic;
using System.Linq;
using InvestmentIntelligence.Data.Repository.Comparers.EntityModelsComparers;
using InvestmentIntelligence.DbModel.Models;

namespace InvestmentIntelligence.Data.Repository.EFImplementation
{
    public class SecurityClassRepository : IIPRepository<SecurityClass>, ISecurityClassUpdatableRepository
    {
        public List<SecurityClass> SaveNew(IEnumerable<SecurityClass> items)
        {
            var classes = GetList(v=>v);
            var newClasses = items.Except(classes, new SecuriryClassComparer());
            Add(newClasses);
            return GetList(v => v);
        }

       
    }
}